package cn.com.api.controller;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import cn.com.api.entity.ApiAddress;
import cn.com.api.entity.ApiCar;
import cn.com.api.entity.ApiT_member;
import cn.com.api.entity.ApiT_order;
import cn.com.api.entity.ApiT_order_detail;
import cn.com.api.entity.ApiTmember;
import cn.com.api.entity.ApiU_message;
import cn.com.api.service.ApiAddressService;
import cn.com.api.service.ApiCarService;
import cn.com.api.service.ApiJuanService;
import cn.com.api.service.ApiMemberService;
import cn.com.api.service.ApiT_memberService;
import cn.com.api.service.ApiT_orderService;
import cn.com.api.service.ApiT_order_detailService;
import cn.com.api.service.ApiT_productsService;
import cn.com.api.service.ApiU_messageService;
import cn.com.uthink.util.DateTimeUtil;
import cn.com.uthink.util.StringUtil;
import cn.com.util.*;

@Controller
@RequestMapping(Utils.SYS_API + "t_order/")
public class ApiT_orderController {
	@Autowired
	private ApiT_orderService apiT_orderService;
	@Autowired
	private ApiT_order_detailService apiT_order_detailService;
	@Autowired
	private ApiJuanService apiJuanService;
	@Autowired
	private ApiMemberService memberService;
	@Autowired
	private ApiCarService apiCarService;
	@Autowired
	private ApiAddressService addressService;
	@Autowired
	private ApiT_memberService apiT_memberService;
	@Autowired
	private ApiU_messageService apiU_messageService;

	private static Logger logger = Logger.getLogger(ApiT_orderController.class);

	/**
	 * 下单
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "create_order")
	public void create_order(HttpServletRequest request, HttpServletResponse response) throws Exception {

		Map<String, Object> map = new HashMap<String, Object>();
		try {
			String userId = request.getParameter("userId");
			String carIds = request.getParameter("carIds");
			String pwd = request.getParameter("pwd");
			String payType = request.getParameter("payType");
			String address = request.getParameter("address");
			String peisong = request.getParameter("peiSong");
			String memo = request.getParameter("mome");
			String sendfee = request.getParameter("sendFee");
			String rIp = request.getParameter("rIp");
			String isQuan = request.getParameter("isQuan");
			String quanId = request.getParameter("quanId");
			String receiptTitle = request.getParameter("receiptTitle");
			String receiptDesc = request.getParameter("receiptDesc");
			String receiptRemark = request.getParameter("receiptRemark");
			map = apiT_orderService.create_order(userId, carIds, pwd, payType, address, peisong, memo, sendfee, rIp,
					isQuan, quanId, receiptTitle, receiptDesc, receiptRemark);
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 我的订单
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	@RequestMapping("findOrderByUserId")
	public void findOrderByUserId(HttpServletRequest request, HttpServletResponse response, PageInfo pageInfo)
			throws Exception {

		Map<String, Object> map = new HashMap<String, Object>();
		try {
			String id = request.getParameter("userId");
			String status = request.getParameter("status");

			List<ApiT_order> list = apiT_orderService.getUserOrders(id, status, pageInfo);
			List<Map<String, Object>> orderMapList = new ArrayList<>();
			Map<String, Object> orderMap = null;
			List<Map<String, Object>> goodsMapList = null;
			Map<String, Object> goodsMap = null;
			for (ApiT_order apiT_order : list) {
				orderMap = new HashMap<>();
				goodsMapList = new ArrayList<>();
				orderMap.put("orderNum", apiT_order.getOrdernum());
				List<Map<String, Object>> orderDetialMapList = apiT_order_detailService
						.getOrderDetailByOrderNum(apiT_order.getOrdernum().toString());
				for (Map<String, Object> orderdetialMap : orderDetialMapList) {
					goodsMap = new HashMap<>();
					goodsMap.put("productId", orderdetialMap.get("PRODUCT_ID"));
					goodsMap.put("goodId", orderdetialMap.get("goodId"));
					goodsMap.put("image", orderdetialMap.get("image"));
					goodsMap.put("name", orderdetialMap.get("name"));
					goodsMap.put("pdtSpec", orderdetialMap.get("PDT_SPEC"));
					goodsMap.put("price", orderdetialMap.get("PRICE"));
					goodsMap.put("num", orderdetialMap.get("num"));
					goodsMapList.add(goodsMap);
				}
				orderMap.put("orderGoods", goodsMapList);
				orderMap.put("plStatus", apiT_order.getPl_status());
				switch (apiT_order.getDd_status()) {
				case 1:// 待付款
					String carId = orderDetialMapList.get(0).get("ext_2").toString();
					String topicId = apiCarService.findApiCarById(Integer.parseInt(carId)).getTopic_id();
					orderMap.put("orderStatus", "待支付");
					orderMap.put("orderStatusId", 1);
					break;
				case 2:// 已支付
					orderMap.put("orderStatus", "代发货");
					orderMap.put("orderStatusId", 2);
					break;
				case 3:// 已发货
					orderMap.put("orderStatus", "代收货");
					orderMap.put("orderStatusId", 3);
					break;
				case 4:// 已确认收货
					orderMap.put("orderStatus", "已完成");
					orderMap.put("orderStatusId", 4);
					break;
				case 5:// 已取消
					orderMap.put("orderStatus", "已取消");
					orderMap.put("orderStatusId", 5);
					break;
				case 6:// 退货中
					orderMap.put("orderStatus", "退货中");
					orderMap.put("orderStatusId", 6);
					break;
				case 7:// 退货成功
					orderMap.put("orderStatus", "退货失败");
					orderMap.put("orderStatusId", 7);
					break;
				case 8:// 退货失败
					orderMap.put("orderStatus", "退货失败");
					orderMap.put("orderStatusId", 8);
					break;
				default:
					break;
				}
				orderMapList.add(orderMap);
			}
			map.put("datas", orderMapList);
			String leftMoney = "0";
			ApiT_member member = apiT_memberService.getMemberById(id);
			if (!Util.isNull(member) && !Util.isNull(member.getC_money())) {
				leftMoney = member.getC_money().toString();
			}
			map.put("memberLeftMoney", leftMoney);
			map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
			map.put(Utils.MESSAGE, "查询成功！");
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 订单详情
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("findT_orderByOrderNum")
	public void findT_orderById(HttpServletRequest request, HttpServletResponse response) throws Exception {

		Map<String, Object> map = new HashMap<String, Object>();
		try {
			String orderNum = request.getParameter("orderNum");
			ApiT_order t_order = apiT_orderService.getOrderByOrderNum(orderNum);
			ApiAddress address = addressService.getAddressById(t_order.getAddress());
			Map<String, Object> returnMap = new HashMap<>();
			if (!Util.isNull(address)) {
				returnMap.put("addressName", address.getName());
				returnMap.put("addressMobile", address.getPhone());
				returnMap.put("address",
						address.getProvince() + address.getCity() + address.getCounty() + address.getAddress());
				returnMap.put("plStatus", t_order.getPl_status());
				returnMap.put("receiptTitle", t_order.getReceipt_title());
				returnMap.put("receiptDesc", t_order.getReceipt_desc());
				returnMap.put("appDate", t_order.getAppdate());
			} else {
				returnMap.put("addressName", "");
				returnMap.put("addressMobile", "");
				returnMap.put("address", "");
				returnMap.put("plStatus", "");
				returnMap.put("receiptTitle", "");
				returnMap.put("receiptDesc", "");
				returnMap.put("appDate", "");
			}

			List<Map<String, Object>> orderDetialMapList = apiT_order_detailService.getOrderDetailByOrderNum(orderNum);
			List<Map<String, Object>> goodsMapList = new ArrayList<>();
			Map<String, Object> goodsMap = null;
			for (Map<String, Object> orderdetialMap : orderDetialMapList) {
				goodsMap = new HashMap<>();
				goodsMap.put("sname", orderdetialMap.get("corp_sname"));
				goodsMap.put("logoImg", orderdetialMap.get("logo_img"));
				goodsMap.put("image", orderdetialMap.get("image"));
				goodsMap.put("name", orderdetialMap.get("name"));
				goodsMap.put("pdtSpec", orderdetialMap.get("PDT_SPEC"));
				goodsMap.put("price", orderdetialMap.get("PRICE"));
				goodsMap.put("num", Integer.parseInt(orderdetialMap.get("num").toString()));
				goodsMap.put("id", Integer.parseInt(orderdetialMap.get("goodId").toString()));
				goodsMap.put("productId", Integer.parseInt(orderdetialMap.get("PRODUCT_ID").toString()));
				goodsMap.put("userId", Integer.parseInt(orderdetialMap.get("user_id").toString()));
				goodsMap.put("userMobile", orderdetialMap.get("user_mobile"));
				goodsMap.put("topicId", apiCarService
						.findApiCarById(Integer.parseInt(orderdetialMap.get("ext_2").toString())).getTopic_id());
				goodsMapList.add(goodsMap);
			}
			returnMap.put("goodInfo", goodsMapList);
			switch (t_order.getDd_status()) {
			case 1:// 待付款
				String carId = orderDetialMapList.get(0).get("ext_2").toString();
				returnMap.put("orderStatus", "待支付");
				returnMap.put("orderStatusId", 1);
				break;
			case 2:// 已支付
				returnMap.put("orderStatus", "待发货");
				returnMap.put("orderStatusId", 2);
				break;
			case 3:// 已发货
				returnMap.put("orderStatus", "待收货");
				returnMap.put("orderStatusId", 3);
				break;
			case 4:// 已确认收货
				returnMap.put("orderStatus", "已完成");
				returnMap.put("orderStatusId", 4);
				break;
			case 5:// 已取消
				returnMap.put("orderStatus", "已取消");
				returnMap.put("orderStatusId", 5);
				break;
			case 6:// 退货中
				returnMap.put("orderStatus", "退货中");
				returnMap.put("orderStatusId", 6);
				break;
			case 7:// 退货成功
				returnMap.put("orderStatus", "退货失败");
				returnMap.put("orderStatusId", 7);
				break;
			case 8:// 退货失败
				returnMap.put("orderStatus", "退货失败");
				returnMap.put("orderStatusId", 8);
				break;
			default:
				break;
			}
			map.put("datas", returnMap);
			map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
			map.put(Utils.MESSAGE, "查询成功！");
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 取消订单
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("cancelOrder")
	public void cancelOrder(HttpServletRequest request, HttpServletResponse response) throws Exception {

		Map<String, Object> map = new HashMap<String, Object>();
		try {
			String cancelReason = request.getParameter("cancelReason");
			// if (!Util.isNull(cancelReason)) {
			// cancelReason = new
			// String(cancelReason.getBytes("ISO-8859-1"),"utf-8");
			// }
			Map<String, Object> conditonMap = new HashMap<>();
			conditonMap.put("orderNum", request.getParameter("orderNum"));
			conditonMap.put("ddStatus", 5);
			conditonMap.put("cancelReason", cancelReason);
			apiT_orderService.cancelOrder(conditonMap);
			map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
			map.put(Utils.MESSAGE, "取消成功！");
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 查询数据集
	 * 
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("findT_orders")
	public void findT_orders(HttpServletRequest request, HttpServletResponse response) throws Exception {

		Map<String, Object> map = new HashMap<String, Object>();
		try {
			List<ApiT_order> t_orders = apiT_orderService.findT_orders();

			// return
			map.put("datas", t_orders);
			map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
			map.put(Utils.MESSAGE, "查询成功！");
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 修改
	 * 
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	@Transactional
	@RequestMapping(value = "updateT_order")
	public void updateT_order(HttpServletRequest request, HttpServletResponse response) throws Exception {

		String id = request.getParameter("rid");
		String titles = request.getParameter("titles");
		String shop_id = request.getParameter("shop_id");
		String user_id = request.getParameter("user_id");
		String peisong = request.getParameter("peisong");
		String name = request.getParameter("name");
		String tel = request.getParameter("tel");
		String mobile = request.getParameter("mobile");
		String email = request.getParameter("email");
		String zip = request.getParameter("zip");
		String address = request.getParameter("address");
		String dtime = request.getParameter("dtime");
		String bz = request.getParameter("bz");
		String money = request.getParameter("money");
		String appuser = request.getParameter("appuser");
		String appdate = request.getParameter("appdate");
		String rip = request.getParameter("rip");
		String enable = request.getParameter("enable");
		String zi_status = request.getParameter("zi_status");
		String dd_status = request.getParameter("dd_status");
		String zf_type = request.getParameter("zf_type");
		String remainmoney = request.getParameter("remainmoney");
		String serial = request.getParameter("serial");
		String serialflagno = request.getParameter("serialflagno");
		String ordertype = request.getParameter("ordertype");
		String paytime = request.getParameter("paytime");
		String sumgoodsprice = request.getParameter("sumgoodsprice");
		String sendfee = request.getParameter("sendfee");
		String takegoodstime = request.getParameter("takegoodstime");
		String cancelreason = request.getParameter("cancelreason");
		String product_ids = request.getParameter("product_ids");
		String car_ids = request.getParameter("car_ids");
		String is_quan = request.getParameter("is_quan");
		String quan_id = request.getParameter("quan_id");
		String paymoney = request.getParameter("paymoney");
		String senddate = request.getParameter("senddate");
		String longitude = request.getParameter("longitude");
		String latitude = request.getParameter("latitude");
		String to_shop_distence = request.getParameter("to_shop_distence");
		String to_user_distence = request.getParameter("to_user_distence");
		String is_send = request.getParameter("is_send");
		String sumpoints = request.getParameter("sumpoints");
		String ordernum = request.getParameter("ordernum");
		String is_lunchbox = request.getParameter("is_lunchbox");
		String lunchbox_price = request.getParameter("lunchbox_price");
		String sum_lunchbox_price = request.getParameter("sum_lunchbox_price");
		String goodscount = request.getParameter("goodscount");
		String is_print = request.getParameter("is_print");
		String cancle_time = request.getParameter("cancle_time");
		String print_time = request.getParameter("print_time");
		String overtime_duty = request.getParameter("overtime_duty");
		String wxpaystr = request.getParameter("wxpaystr");
		String ext_1 = request.getParameter("ext_1");
		String ext_2 = request.getParameter("ext_2");
		String ext_3 = request.getParameter("ext_3");
		String ext_4 = request.getParameter("ext_4");
		String ext_5 = request.getParameter("ext_5");

		// String id = request.getParameter("id");
		Map<String, Object> map = new HashMap<String, Object>();

		try {
			if (id != null && !"".equals(id.trim())) {
				ApiT_order t_order = new ApiT_order();
				// 获取原数据
				t_order = apiT_orderService.findT_orderById(Integer.valueOf(id));
				// 修改
				// t_order.setIs_open(Integer.valueOf(is_open));
				//
				int ret_i = apiT_orderService.updateT_order(t_order);

				map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
				map.put(Utils.MESSAGE, "编辑成功！");
			} else {
				map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
				map.put(Utils.MESSAGE, "检查失败！");
			}
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}

		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 逻辑删除订单
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "deleteT_order")
	public void deleteT_order(HttpServletRequest request, HttpServletResponse response) throws Exception {

		String id = request.getParameter("id");
		Map<String, Object> map = new HashMap<String, Object>();

		try {
			if (id != null && !"".equals(id.trim())) {
				apiT_orderService.updateOrderEnable(id);
				map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
				map.put(Utils.MESSAGE, "删除成功！");
			}
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 根据userId获得用户余额
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "getLeftMoneyByUserId")
	public void getLeftMoneyByUserId(HttpServletRequest request, HttpServletResponse response) throws Exception {

		Map<String, Object> map = new HashMap<String, Object>();
		try {
			String leftMoney = "0";
			ApiT_member member = apiT_memberService.getMemberById(request.getParameter("userId"));
			if (!Util.isNull(member) && !Util.isNull(member.getC_money())) {
				leftMoney = member.getC_money().toString();
			}
			map.put("leftMoney", leftMoney);
			map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
			map.put(Utils.MESSAGE, "查询成功！");
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 确认收货
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	@RequestMapping(value = "getProduct")
	public void getProduct(HttpServletRequest request, HttpServletResponse response) throws Exception {

		String orderNum = request.getParameter("orderNum");
		String pwd = request.getParameter("pwd");
		Map<String, Object> map = new HashMap<String, Object>();
		try {
			ApiT_order order = apiT_orderService.getOrderByOrderNum(orderNum);
			if (!Util.isNull(memberService.checkPayPass(order.getUser_id(), CipherUtil.generatePassword(pwd)))) {
				BigDecimal payMoney = order.getPaymoney();
				String leftMoney = "0";
				ApiT_member member = apiT_memberService.getMemberById(order.getShop_id());
				if (!Util.isNull(member) && !Util.isNull(member.getC_money())) {
					leftMoney = member.getC_money().toString();
				}
				apiT_orderService.updateOrderDDstatusByOrderNum(orderNum, "4");
				apiT_memberService.updateMemberMoneyByUserId(order.getShop_id(),
						payMoney.add(Util.getBigDecimal(leftMoney)));
				map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
				map.put(Utils.MESSAGE, "收货成功！");
			} else {
				map.put(Utils.RESULT, "0033");
				map.put(Utils.MESSAGE, "密码错误");
			}
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 提醒发货
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	@Transactional
	@RequestMapping(value = "tipSendProduct")
	public void tipSendProduct(HttpServletRequest request, HttpServletResponse response) throws Exception {

		String orderNum = request.getParameter("orderNum");
		String time = DateUtil.nowTimeToString();
		Map<String, Object> map = new HashMap<String, Object>();
		try {
			ApiT_order apiT_order = apiT_orderService.getOrderByOrderNum(orderNum);
			apiT_orderService.updateRemindShipmentByOrderNum(orderNum, time);

			List<ApiU_message> messages = new ArrayList<ApiU_message>();
			ApiU_message message = new ApiU_message();
			message.setConn_id(Integer.parseInt(apiT_order.getUser_id()));// 发送者
			message.setType(9);// 提醒发货
			message.setAdd_time(time);
			message.setIs_read(0);
			message.setUser_id(apiT_order.getShop_id());// 接受者
			message.setTitle("提醒发货");
			message.setContent(apiT_order.getName() + " 于 " + time + " 提醒您发货");

			messages.add(message);
			apiU_messageService.insertmessageList(messages);
			map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
			map.put(Utils.MESSAGE, "操作成功！");
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

	/**
	 * 获得快递信息
	 * 
	 * @author JW
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	@RequestMapping(value = "getExpressInfo")
	public void getExpressInfo(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String exsNum = request.getParameter("orderNum");
		String exsName = apiT_orderService.findT_orderByOrderNum(exsNum).getExpress_corp();
		Map<String, Object> map = new HashMap<String, Object>();
		String expressContent = "";
		String expressType = "json";
		try {
			if ("shunfeng".equals(exsName) || "ems".equals(exsName)) {
				expressContent = Express100.searchkuaiDiInfo(exsName, exsNum);
				expressType = "html";
			} else {
				expressContent = Express100.getExpressInfo(exsName, exsNum);
			}
			map.put("expressContent", expressContent);
			map.put("expressType", expressType);
			map.put(Utils.RESULT, Utils.RESULT_RC_SUCCESS);
			map.put(Utils.MESSAGE, "查询成功");
		} catch (Exception e) {
			logger.error(Util.getStackTraceAsString(e));
			e.printStackTrace();
			map.put(Utils.RESULT, Utils.RESULT_RC_CHECK_FAIL);
			map.put(Utils.MESSAGE, "系统异常！");
		}
		JsonUtil.printJson(response, JsonUtil.object2json(map));
	}

}
